//package com.jcoinexchange.market.controller;
//
//import com.jcoinexchange.market.common.vo.WsMarketReq;
//import com.jcoinexchange.web.entity.BasicResponse;
//import com.jcoinexchange.market.common.vo.WSBasicResponse;
//import com.jcoinexchange.web.entity.BasicResponse;
//import com.jcoinexchange.market.ws.WSServer;
//import com.jcoinexchange.web.entity.ResponseBaseCode;
//import io.swagger.v3.oas.annotations.Operation;
//import io.swagger.v3.oas.annotations.tags.Tag;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.validation.BindingResult;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import jakarta.validation.Valid;
//
//@Tag(name = "推送信息")
//@RestController
//@RequestMapping("push")
//public class PushController {
//
//    @Autowired
//    private WSServer wsServer;
//
//    @Operation(summary = "推送行情数据")
//    @PostMapping("/market")
//    public BasicResponse market(@RequestBody @Valid WsMarketReq req,
//                          BindingResult bindingResult) {
//
//        if (bindingResult.hasErrors()) {
//            return BasicResponse.error(ResponseBaseCode.ERROR_PARAM_INVALID, bindingResult.getFieldError().getDefaultMessage());
//        }
//
//        Long memberId = req.getMemberId();
//        Long orderId = req.getOrderId();
//        if (memberId != null) {
//            WSBasicResponse orderWSBasicResponse = new WSBasicResponse();
//            orderWSBasicResponse.setType(3);
//            orderWSBasicResponse.setData(orderId.toString());
//            wsServer.sendMsg(memberId.toString(), orderWSBasicResponse);
//        }
//        WSBasicResponse WSBasicResponse = new WSBasicResponse();
//        WSBasicResponse.setType(2);
//        WSBasicResponse.setData(req.getData());
//        wsServer.full(WSBasicResponse);
//
//        return BasicResponse.success();
//    }
//
//}
